package hangman.Ana.Gilles;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

public class Lose extends Activity implements OnClickListener {
   @Override
   protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.lose);
      
      //set on Click listenners
      View newGameButton = findViewById(R.id.newGame);
      newGameButton.setOnClickListener(this);
      View menuButton = findViewById(R.id.menu);
      menuButton.setOnClickListener(this);
   }

   @Override
   public void onClick(View v) {
	   Intent j = new Intent ();
	   switch (v.getId()){
	   		//go back to main menu
			case R.id.menu:
				j=new Intent (this, HangManActivity.class);
				startActivity(j);
				finish();
				break;
			//open the difficulty window for a new game
			case R.id.newGame:
				j = new Intent (this, Game.class);
				startActivity(j);	
				finish();
				break;
	   	}
   }
}
